﻿<phone:PhoneApplicationPage 
    xmlns:krempel="clr-namespace:Krempel.WP7.Core.Controls;assembly=Krempel.WP7.Core"  
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    x:Class="Krempel.WP7.TestApp.Examples.HtmlTextBlockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:commands="clr-namespace:Krempel.WP7.TestApp.Commands"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    Loaded="PhoneApplicationPage_Loaded">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <krempel:ItemTurnstileTransition XMode="BackwardIn" YMode="BottomToTop" />
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <krempel:ItemTurnstileTransition XMode="ForwardIn" YMode="BottomToTop" />
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <krempel:ItemTurnstileTransition XMode="BackwardOut" YMode="TopToBottom" />
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <krempel:ItemTurnstileTransition XMode="ForwardOut" YMode="TopToBottom" />
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
    <phone:PhoneApplicationPage.Resources>
        <commands:NavigationCommand x:Key="NavigationCommand" />
    </phone:PhoneApplicationPage.Resources>
    
    <Grid x:Name="LayoutRoot" Background="Transparent">
    	<controls:Pivot Title="KREMPEL's WP7 SNIPPETS">
    		<controls:PivotItem Header="Non formatted HTML">
                <phone:WebBrowser krempel:ItemTurnstileTransition.IsTurnstileItem="True" x:Name="nonFormattedBrowser" Height="600" Width="450" />
    		</controls:PivotItem>

    		<controls:PivotItem Header="Formatted HTML">
                <phone:WebBrowser krempel:ItemTurnstileTransition.IsTurnstileItem="True" x:Name="formattedBrowser" Width="450" Height="600" />
    		</controls:PivotItem>

    		<controls:PivotItem Header="HTMLTextBlock">
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                    <krempel:HtmlTextBlock krempel:ItemTurnstileTransition.IsTurnstileItem="True" x:Name="htmlTextBlock" NavigationCommand="{StaticResource NavigationCommand}" NavigationRequested="htmlTextBlock_NavigationRequested" Html="{Binding}" />
                </ScrollViewer>
            </controls:PivotItem>
            
            <controls:PivotItem Header="Test Yurii">
                <StackPanel>
                    <krempel:HtmlTextBlock x:Name="TestHTMLTextBox" Html="lorem ipsum" Margin="0,0,80,0" VerticalAlignment="Top" HorizontalAlignment="Left" H1Foreground="{StaticResource PhoneAccentBrush}" H1FontFamily="Segoe WP SemiLight" H2FontFamily="Times New Roman" H1FontWeight="Light" H1FontSize="41" H2FontSize="5"/>
                    <Button Name="TestButton" Content="Test" Click="TestButton_Click" />
                </StackPanel>
            </controls:PivotItem>
    	</controls:Pivot>
    </Grid>
    
</phone:PhoneApplicationPage>